From: Jasper St. Pierre Date: Tue, 11 Jun 2013 23:12:46 +0000 (-0400) Subject: popupMenu: Only allow one submenu to be open at a time X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3939 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5c036eadf944cb06d792c0b5210e0928342a548a;p=gnome-shell.git popupMenu: Only allow one submenu to be open at a time When the user opens another submenu, close the first one. https://bugzilla.gnome.org/show_bug.cgi?id=702539 --- diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index ce7f3cce3..c2bc99623 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -1005,6 +1005,14 @@ const PopupMenu = new Lang.Class({ this.actor.reactive = true; this._childMenus = []; + this._openedSubMenu = null; + }, + + _setOpenedSubMenu: function(submenu) { + if (this._openedSubMenu) + this._openedSubMenu.close(true); + + this._openedSubMenu = submenu; }, _boxGetPreferredWidth: function (actor, forHeight, alloc) { @@ -1299,6 +1307,8 @@ const PopupSubMenuMenuItem = new Lang.Class({ this.actor.add_style_pseudo_class('open'); else this.actor.remove_style_pseudo_class('open'); + + this._getTopMenu()._setOpenedSubMenu(this.menu); }, destroy: function() {